<template>
  <div>
    <div class="md-modal" v-if="mdShow">
      <div class="md-modal-inner">
        <div class="md-top">
          <button class="md-close" @click="closeModal">Close</button>
        </div>
        <div class="md-content">
          <div class="confirm-tips">
            <slot name="message"></slot>
          </div>
          <div class="btn-wrap">
            <slot name="btnGroup"></slot>
          </div>
        </div>
      </div>
    </div>
    <div class="md-overlay" v-if="mdShow" @click="closeModal"></div>
  </div>
</template>

<script>
export default {
  // 父子通信，子组件不能影响父组件传递的状态，不能逆向修改
  props: ['mdShow'],
  data () {
    return {
      msg: 'hello'
    }
  },
  methods: {
    closeModal () {
      this.$emit('close')
    }
  }
}
</script>
